<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored = "false" %> 
<%@ page language="java" import="com.jxLC.Action.*"%>
<%@ page language="java" import="com.jxLC.Model.*" %>
<%@ page language="java" import="com.jxLC.Service.*" %>
<%@include file="/checkLoginSession.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
TopicService topicService=new TopicService();
List<Topic> topics=topicService.gettopic();
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>:::江西低碳-管理员后台:::</title>
	<link href="/mycss/my.css"  rel="stylesheet" type="text/css" />
	<link href="/mycss/cm.css"  rel="stylesheet" type="text/css" />
	<link href="/mycss/details.css"  rel="stylesheet" type="text/css" />
	<script type="text/javascript" charset="utf-8" src="/Kindeditor/kindeditor.js"></script>
	<script type="text/javascript" src="/myjs/my.js"></script>
	<script type="text/javascript" src="/myjs/up.js"></script>
	<script type="text/javascript">
	   var msg="${requestScope.tip}";
       if(msg!=""){
          alert(msg);
       }
   		function checkForm(myform) {				
				if(myform.image1.value == ""&&myform.image2.value == ""&&myform.image3.value == ""){
				    alert('请选择您要上传的图片！');
					return false;
					}
				return true;	
			}
		function checkExt1(obj){
		      imageSpan1.innerHTML="";
		      this.AllowExt=".jpg,.gif,.bmp,.png"; 
		      this.FileExt=obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();   
              if(this.AllowExt.indexOf(this.FileExt)==-1)   
            {   
                 imageSpan1.innerHTML="(*该图片类型不允许上传)";
                 return false;    
             }   
		    return true;
		}
		function checkExt2(obj){
		      this.AllowExt=".jpg,.gif,.bmp,.png"; 
		      this.FileExt=obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();   
              if(this.AllowExt.indexOf(this.FileExt)==-1)   
            {   
                 imageSpan2.innerHTML="(*该图片类型不允许上传)";
                 return false;    
             }   
		    return true;
		}
		function checkExt3(obj){
		      this.AllowExt=".jpg,.gif,.bmp,.png"; 
		      this.FileExt=obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();   
              if(this.AllowExt.indexOf(this.FileExt)==-1)   
            {   
                 imageSpan3.innerHTML="(*该图片类型不允许上传)";
                 return false;    
             }   
		    return true;
		}
	//	window.onload=load;
	</script>	
	<style type="text/css">
	 table,td,th{ font-size:14px； font-family: "宋体 "; border:1px solid #339966;border-collapse:collapse; }
	 th{background:#EBFCF3;}
	 #m{background-color:white}
	 #ma{height:30px; background-image:url(../my.photo/photo/h3.jpg); color:white;padding-top:5px;}
	 #mb{float: left; width:240px;height:100%; background-color: ; margin:3px;}
	 #mb2{height:30px;background-color:#339966;width:220px; color:white; padding:6px;margin-top:2px;font-weight: bold; }
	 #mb3 a{ text-decoration: none; color:#006699;font-size:14px; font-weight: bold;}
	 #mb3 a:hover{color:green}
	 #mc{float: left;}
	 #mc1{height:10px;background-color: #339966; width:98%;padding-left:4px;margin-top:4px;overflow:hidden;}
	 #mc2{padding-left:10px;margin-top:20px;}
	 #imag{margin-top:10px;}
	 #imag input{margin-left:40px;}
    </style>
    <script type="text/javascript">
        var result ="<%=request.getAttribute("success")%>";
	</script>
  </head>
  
 <body style="background-color:#EBFCF3">
    <s:include value="/admin/header.jsp"></s:include>
	<center><div id="m" >
       <s:include value="/admin/left.jsp"></s:include>
       <div id="mc">
          <div id="mc1"></div>
          <div id="mc2">
           <h4 align="left"><img  src="/my.photo/photo/to.gif"><font style="color:black;font-family: 仿宋 ;font-weight: bold;">当前用户：</font><font style="color:blue;font-family: 仿宋 ;font-weight: bold;">管理员</font></h4>
           <h4 align="left"><img  src="/my.photo/photo/to.gif"><font style="color:black;font-family: 仿宋 ;font-weight: bold;">当前位置：</font><font style="color:blue;font-family: 仿宋 ;font-weight: bold;">首页图片上传</font></h4>
          </div>
          <div id="imag"><h3>首页图片上传</h3></div>
          <form action="indexPicUpload.action" enctype="multipart/form-data" method="post" onsubmit="return checkForm(this);">
              <div style="margin-left:10px;color:blue"  ><h5>允许上传图片的类型有jpg ,gif ,bmp ,png</h5></div>     
              <table>
              	<tr>
              		<td> 图片一</td>
              		<td>
              	    <input type="file"  name="annex"  onchange="checkExt1(this)"/><br/>
				            链接地址：<input type="text" name="piclink" size="80"><br/>
				            文字说明：<input type="text" name="info" size="50">
				            显示顺序：<select name="issue">
						            <option value="1" selected="selected">1</option>
						            <option value="2">2</option>
						            <option value="3">3</option>
						            <option value="4">4</option>
						            <option value="5">5</option>
						            <option value="6">6</option>
						      </select>
              		</td>
              	</tr>
              	<tr>
              		<td> 图片二</td>
              		<td>
              	    <input type="file"  name="annex"  onchange="checkExt1(this)"/><br/>
				            链接地址：<input type="text" name="piclink" size="80"><br/>
				            文字说明：<input type="text" name="info" size="50">
				            显示顺序：<select name="issue">
						            <option value="1">1</option>
						            <option value="2" selected="selected">2</option>
						            <option value="3">3</option>
						            <option value="4">4</option>
						            <option value="5">5</option>
						            <option value="6">6</option>
						      </select>
              		</td>
              	</tr>
              	<tr>
              		<td> 图片三</td>
              		<td>
              	    <input type="file"  name="annex"  onchange="checkExt1(this)"/><br/>
				            链接地址：<input type="text" name="piclink" size="80"><br/>
				            文字说明：<input type="text" name="info" size="50">
				            显示顺序：<select name="issue">
						            <option value="1">1</option>
						            <option value="2">2</option>
						            <option value="3" selected="selected">3</option>
						            <option value="4">4</option>
						            <option value="5">5</option>
						            <option value="6">6</option>
						      </select>
              		</td>
              	</tr>
              		<tr>
              		<td> 图片四</td>
              		<td>
              	    <input type="file"  name="annex"  onchange="checkExt1(this)"/><br/>
				            链接地址：<input type="text" name="piclink" size="80"><br/>
				            文字说明：<input type="text" name="info" size="50">
				            显示顺序：<select name="issue">
						            <option value="1">1</option>
						            <option value="2">2</option>
						            <option value="3">3</option>
						            <option value="4" selected="selected">4</option>
						            <option value="5">5</option>
						            <option value="6">6</option>
						      </select>
              		</td>
              	</tr>
              </table>         
            <span id="imageSpan1" style="color:red;padding:20px;fontSize:12px"> </span>
           
               <input type="submit" value="上传" style="margin-top:10px;width:100px"/>
               <s:fielderror name="file" cssStyle="color: red"/> 
             </form> 
          </div>
       </div></center>
	<s:include value="/admin/tail.jsp"></s:include>
</body>
</html>


